package domain;

public class Turn implements Comparable<Turn> {
	private PTime startTime;
	private PTime endTime;
	
	public Turn(PTime startTime, PTime endTime) {
		this.setStartTime(startTime);
		this.setEndTime(endTime);
	}
	
	public PTime getStartTime() {
		return startTime;
	}
	
	public void setStartTime(PTime startTime) {
		this.startTime = startTime;
	}
	
	public PTime getEndTime() {
		return endTime;
	}
	
	public void setEndTime(PTime endTime) {
		this.endTime = endTime;
	}
	
	@Override
	public boolean equals(Object o) {
		if (o == null || this.getClass() != o.getClass()) {
			return false;
		}
		if (o == this) {
			return true;
		}
		Turn t = (Turn) o;
		return this.getStartTime().equals(t.getStartTime())
			&& this.getEndTime().equals(t.getEndTime());
	}

	@Override
	public int compareTo(Turn other) {
		return this.getStartTime().compareTo(other.getStartTime());
	}
	
}
